include ../ffox.mk

TARGET=	libstm32core.a
SRCS=	core_cm3.c \
	system_stm32f10x.c

OBJS:=$(SRCS:%.c=%.o)

STARTUP_TYPE = startup_stm32f10x_md
STARTUP_TARGET = startup_stm32f10x.o
STARTUP_SRC = $(STARTUP_TYPE).s

all: $(TARGET) $(STARTUP_TARGET)

$(TARGET): $(OBJS)
	$(AR) r $(TARGET) $(OBJS)

$(STARTUP_TARGET): $(STARTUP_SRC)
	$(AS) -o $(STARTUP_TARGET) $(STARTUP_SRC)

clean:
	rm -f $(TARGET) $(OBJS) $(STARTUP_TARGET)

depend:
	$(CC) $(CFLAGS) -MM $(SRCS) >.depend

-include .depend

